@include('Home.head')
<body>
<div class="container" id="app">
    <header data-am-widget="header" class="am-header am-header-default my-header">
        <div class="am-header-left am-header-nav">
            <a href="javascript:history.back(-1);" class="">
                <i class="am-header-icon am-icon-chevron-left"></i>
            </a>
        </div>
        <h1 class="am-header-title">
            <a href="#title-link" class="">提交订单</a>
        </h1>
        <div class="am-header-right am-header-nav">
            <a href="#right-link" class="">
                <i class="am-header-icon  am-icon-home"></i>
            </a>
        </div>
    </header>
	<div class="gray-panel">
    	<div class="paoduct-title-panel">
        	<h2 class="checkout-h2"><span class="am-badge am-round am-badge-warning ">1</span> 确认订单信息</h2>
			<div v-if="order.ordertype != 2">
                <div class="cart-list-panel">
                    <ul class="am-avg-sm-1 cart-panel-ul">
                        <li>
                            <div class="imgpanel"><a href="#"><img style="height: 100px" :src="order.mallGoods.img" class="am-img-responsive" /></a></div>
                            <div class="infopanel">
                                <h3><a href="#">@{{ order.mallGoods.goodsname }}</a></h3>
                                <p>品牌：新世界</p>
                                <p>价格：<span class="red2 bold">@{{ order.price }}</span>
                                {{--<p>库存：<span class="red2 bold">100</span> 件</p>--}}
                                {{--<p>运费：<span class="red2 bold">3</span> 元</p>--}}
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="cart_foot">共选中：@{{ order.mall_num }}， 总价：<span class="red2 bold" id="total_amount">@{{ order.price }}</span>元</div>
            </div>
            <div v-if="order.ordertype == 2">
                <div class="cart-list-panel">
                    <ul class="am-avg-sm-1 cart-panel-ul">
                        <li v-for="val in order.OrderComment">
                            <div class="imgpanel"><a v-on:click="jump(val.goodsid)"><img :src="val.img" class="am-img-responsive" /></a></div>
                            <div class="infopanel">
                                <h3><a v-on:click="jump(val.goodsid)">@{{ val.goodsname }}</a></h3>
                                <p>品牌：新世界</p>
                                <p>价格：<span class="red2 bold">@{{ val.price }}</span> 元  X @{{ val.number }}
                                <p>单价：<span class="red2 bold">@{{ val.totalPrice }}</span> 元</p>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="cart_foot">共选中：<span class="red2 bold" id="total_good">@{{ order.totalNumber }}</span>种商品，
                    总数量：<span class="red2 bold" id="total_jifen">@{{ order.totalShopNumber }}</span> 个，
                    邮费：<span class="red2 bold" id="total_amount" v-if="order.is_self == 0">@{{ order.freight }}</span>
                    <span class="red2 bold" id="total_amount" v-if="order.is_self == 1">自提</span>元，
                    总价：<span class="red2 bold" id="total_amount">@{{ order.originalprice }}</span>元
                </div>
                {{--<div class="cart_foot">共选中：<span class="red2 bold" id="total_good">@{{ order.totalNumber }}</span>种商品，总数量：<span class="red2 bold" id="total_jifen">@{{ order.totalShopNumber }}</span> 个， 总价：<span class="red2 bold" id="total_amount">@{{ order.originalprice }}</span>元</div>--}}
            </div>

            {{--<div class="cart_foot">共选中：<span class="red2 bold" id="total_good">@{{ total }}</span> 种商品，总价：<span class="red2 bold" id="total_amount">@{{ totalPrice }}</span> 元，总数量：<span class="red2 bold" id="total_jifen">@{{ totalNumber }}</span> 个</div>--}}
        </div>
        <div class="paoduct-title-panel">
            <h2 class="checkout-h2"><span class="am-badge am-round am-badge-warning ">2</span> 收货地址</h2>
            <div class="partners-title-panel" >
              <!--   <div class="partners-title-panel-title " v-if="address != ''" style="height: auto;padding-left: 10px;">
                  @{{ address.name }}  &nbsp;@{{ address.phone }}
                  <a v-show="address.default" style="color: red;float: right;margin-right: 20px"></a><br>
                  <a>@{{ address.province }} @{{ address.city }} @{{ address.district }} @{{ address.address }}</a>
                  {{--<span class="am-fr am-icon-trash-o" v-on:click="del(val.id,index)"></span><span class="am-fr am-icon-pencil-square-o" v-on:click="edit(val.id)"></span>--}}
              </div> -->
                <div class="partners-title-panel-title "  style="height: auto;padding-left: 10px;">
                    @{{ order.receipt_name }}  &nbsp;@{{ order.receipt_phone }}
                    <a v-show="address.default" style="color: red;float: right;margin-right: 20px"></a><br>
                    <a>@{{ order.receipt_adr }}</a>
                </div>
            </div>
        </div>

        <div class="paoduct-title-panel">
            <h2 class="checkout-h2"><span class="am-badge am-round am-badge-warning ">3</span> 快递信息</h2>
            <div class="partners-title-panel" >
                <div class="partners-title-panel-title " style="height: auto;padding-left: 10px;">
                     快递名称  &nbsp;@{{ order.expressage }}
                    <a v-show="address.default" style="color: red;float: right;margin-right: 20px"></a><br>
                     快递单号  &nbsp;@{{ order.courier_number }}
                    <a v-show="address.default" style="color: red;float: right;margin-right: 20px"></a><br>
                     备注  &nbsp;@{{ order.remark }}
                    <a v-show="address.default" style="color: red;float: right;margin-right: 20px"></a><br>
                </div>
            </div>
        </div>


    </div>
    @include('Home.foot')
</div>
</body>
<script>
    var app = new Vue({
        el: "#app",
        data: {
            title: '我的订单',
            order:{},
            address:{},
        },
        methods: {
            //初始化 系统管理员列表
            initialize: function () {
                var id = this.obtain('id');
                if (id > 0) {
                    $.post("/home/order", {'_token': '{{csrf_token()}}',class:'find',id:id,again:0, stores:1 }, function (res) {
                        if (res.code) {
                            app.order = res.data.order
                            console.log( app.order );
                            console.log( app.address );
                            app.address = res.data.address
                        } else {
                            layer.msg(res.data);
                        }
                    });
                }
            },
            jump:function (id) {
                window.location.href='/home/microShop/productmicro?id='+id;
            },
            //获取url id
            obtain:function (val) {
                var query = window.location.search.substring(1);
                var vars = query.split("&");
                for (var i=0;i<vars.length;i++) {
                    var pair = vars[i].split("=");
                    if(pair[0] == val){
                        return pair[1];
                    }
                }
            },
        },
        //自动执行
        mounted: function () {
            this.initialize();
        },
    })
</script>
</html>
